<?php
/*
 * @Author: 李志刚
 * @CopyRight: 2020-2030 衡水山木枝技术服务有限公司
 * @Date: 2018-03-12 11:32:28
 * @Description: 用户三级分销的级别
 * @LastEditors: 李志刚
 * @LastEditTime: 2021-10-20 09:02:00
 * @FilePath: /归档/user/2018_03_12_084349_create_distribution.php
 */

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateDistribution extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('distribution', function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->id();
            $table->foreignId('user_id')->default(0)->comment('用户ID');
            $table->foreignId('parent_id')->default(0)->comment('父级ID');
            $table->foreignId('father_id')->default(0)->comment('祖级ID');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('distribution');
    }
}
